package com.sojson.util.mail;

import com.sojson.util.mail.interfaces.MailUtilInterface;
import com.sojson.util.mail.interfaces.impl.MailUtilImpl;

/**
 * 发送邮件工具类
 *
 * @author Liu
 *
 */
public class MailUtil {

    private static final MailUtilInterface MAIL_UTIL_INTERFACE = MailUtilImpl.getInstances();

    /**
     * 发送一封邮件
     *
     * @param target    目标邮箱
     * @param title     邮件标题
     * @param content   邮件内容
     * @throws Exception
     */
    public static void send(String target, String title, String content) throws Exception {
        MAIL_UTIL_INTERFACE.send(target, title, content);
    }

    /**
     * 发送多封邮件
     *
     * @param targets   目标邮箱
     * @param title     邮件标题
     * @param content   邮件内容
     * @throws Exception
     */
    public static void send(String[] targets, String title, String content) throws Exception {
        MAIL_UTIL_INTERFACE.send(targets, title, content);
    }

}